package com.wish.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.wish.dto.RoleDto;
import com.wish.entity.SysRole;
import com.wish.mapper.SysRoleMapper;
import com.wish.service.ISysRoleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 角色 服务实现类
 * </p>
 *
 * @author 五组
 * @since 2021-03-22
 */
@Service
public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> implements ISysRoleService {

    @Autowired
    SysRoleMapper sysRoleMapper;


    @Override
    public PageInfo<SysRole> getlist(RoleDto roleDto) {

        PageHelper.startPage(roleDto.getPageNum(),roleDto.getPageSize());
        List<SysRole> list = sysRoleMapper.getlist(roleDto);
        return new PageInfo<>(list);
    }

    @Override
    public SysRole getOneRole(Integer id) {
        return sysRoleMapper.getOneRole(id);
    }

    @Override
    public List<SysRole> queryList(Long deptId, Integer id) {
        return  baseMapper.queryList(deptId,id);
    }
}
